home *** CD-ROM | disk | FTP | other *** search
/ Megaware 1 / Megaware Volume 1.iso / communic / procom24 / prcmutil.exe / arc / PCP-MENU.CMD < prev    next >
OS/2 REXX Batch file  |  1986-09-21  |  14KB  |  443 lines

  1. ;*********************************************************************
  2. ;
  3. ; ProComm 2.4 Command file to dial PC Pursuit numbers.  Demonstrates
  4. ; menu building, branching on user input, etc.  Please note that only
  5. ; three cities are implemented in this demo.
  6. ;
  7. ; String variables are used extensively here.  Their uses are:
  8. ;
  9. ; S0 - holds user input for SWITCHing
  10. ; S1 - holds PCP city name
  11. ; S2 - holds PCP city area code
  12. ; S3 - holds final destination name
  13. ; S4 - holds final destination phone number
  14. ; S5 - holds user input for SWITCHing
  15. ; S6 - you must set to modem dial command and local TELENET number
  16. ; S7 - you must set to apporpriate baud rate (3 or 12)
  17. ; S8 - you must set to your PCP user id
  18. ; S9 - you must set to your PCP password
  19. ;
  20. ;*********************************************************************
  21.  
  22.  
  23.  
  24. ; Customization area - you need to change these for your setup
  25.  
  26.  
  27.    ASSIGN S9 "12"               ; Enter the baudrate to use here, 3 or 12
  28.    ASSIGN S8 "xxxxxxx"          ; Enter the id to be used here
  29.    ASSIGN S7 "xxxxxxxx"         ; Enter the password to be used here
  30.    ASSIGN S6 "ATDTxxx-xxxx!"    ; Enter dial cmd and local telenet # here
  31.  
  32.  
  33.    SET CR_IN CR                 ; make sure no extra LF's in menus
  34.    CLEAR                        ; clear the screen
  35.  
  36.    LOCATE 1,0                   ; position the cursor
  37.  
  38. ; Build the first menu
  39.  
  40.    MESSAGE "                       ┌┤ PC PURSUIT AVAILABLE CITIES ├┐"
  41.    MESSAGE "                       │                               │"
  42.    MESSAGE "                       │       1- ATLANTA              │"
  43.    MESSAGE "                       │       2- BOSTON               │"
  44.    MESSAGE "                       │       3- DALLAS               │"
  45.    MESSAGE "                       │       4- DENVER               │"
  46.    MESSAGE "                       │       5- DETROIT              │"
  47.    MESSAGE "                       │       6- HOUSTON              │"
  48.    MESSAGE "                       │       7- LOS ANGELES          │"
  49.    MESSAGE "                       │       8- NEWARK               │"
  50.    MESSAGE "                       │       9- NEW YORK             │"
  51.    MESSAGE "                       │      10- PHILADELPHIA         │"
  52.    MESSAGE "                       │      11- SAN FRANCISCO        │"
  53.    MESSAGE "                       │      12- SEATTLE              │"
  54.    MESSAGE "                       │      13- WASHINGTON, DC       │"
  55.    MESSAGE "                       ├───────────────────────────────┤"
  56.    MESSAGE "                       │ ENTER THE # OF THE CITY OF    │"
  57.    MESSAGE "                       │ YOUR CHOICE:                  │"
  58.    MESSAGE "                       └───────────────────────────────┘"
  59.  
  60. L1:                             ; label for use by default case
  61.  
  62.    LOCATE 18,38                 ; position cursor
  63.    MESSAGE "  "                 ; clear prompt area
  64.    LOCATE 18,38                 ; reposition cursor
  65.    GET S0 2                     ; get users choice
  66.  
  67.    SWITCH S0                    ; switch on choice
  68.  
  69.       CASE "1"                  ; chose ATLANTA
  70.          ASSIGN S1 "ATLANTA"    ; save the city name
  71.          ASSIGN S2 "404"        ; save the area code
  72.          GOSUB ATLANTA          ; go get number to dial
  73.       ENDCASE
  74.  
  75.       CASE "5"                  ; chose DETROIT
  76.          ASSIGN S1 "DETROIT"    ; save the city name
  77.          ASSIGN S2 "313"        ; save the area code
  78.          GOSUB DETROIT          ; go get number to dial
  79.       ENDCASE
  80.  
  81.       CASE "13"                       ; chose WASHINGTON DC
  82.          ASSIGN S1 "WASHINGTON, DC"   ; save the city name
  83.          ASSIGN S2 "202"              ; save the area code
  84.          GOSUB WASHINGTON_DC          ; go get number to dial
  85.       ENDCASE
  86.  
  87.       DEFAULT                   ; all other cases
  88.          LOCATE 22,24
  89.          MESSAGE "^G"           ; error noise
  90.          LOCATE 22,24
  91.          MESSAGE "Not yet implemented in this demo"
  92.          LOCATE 22,24
  93.          PAUSE 2
  94.          MESSAGE "                                "
  95.          GOTO L1
  96.       ENDCASE
  97.    ENDSWITCH
  98.  
  99. ;
  100. ; Ok, call the local TELENET number first.  This is an example of
  101. ; redialing without using the DIAL or Alt-R commands
  102. ;
  103.  
  104.    CLEAR                        ; ready to call TELENET
  105.    SET PARITY EVEN              ; set parms for TELENET
  106.    SET DATABITS 7
  107.    MESSAGE "DIALING PCP"        ; let em know whats happening
  108.    LOCATE 0,12
  109.    MESSAGE S1                   ; include city in message
  110.  
  111. L2:                             ; label for busy TELENET
  112.  
  113.    TRANSMIT S6                  ; call local Telenet
  114.    WAITFOR "CONNECT" 15         ; give it 15 seconds to answer
  115.  
  116.    IF NOT WAITFOR               ; it didn't connect, assume busy
  117.       CLEAR                     ; example of redialing without Alt-R
  118.       HANGUP
  119.       MESSAGE "PCP TELENET IS BUSY.  REDIALING..."
  120.       GOTO L2
  121.    ENDIF
  122.  
  123. ;
  124. ; Ok, made it to local telenet number, now call the remote PCP city
  125. ; Notice that we redial at this point as well
  126. ;
  127.  
  128.    PAUSE 2
  129.    TRANSMIT "^m^m"              ; Get Telenet's attention
  130.    WAITFOR "="                  ; Wait for 'TERMINAL=' prompt
  131.    TRANSMIT "D1!"               ; Enter terminal type
  132.    WAITFOR "@"                  ; Wait for Telenet prompt
  133.  
  134. L3:                             ; label for busy remote PCP city
  135.    TRANSMIT "C DIAL"
  136.    TRANSMIT S2                  ; area code
  137.    TRANSMIT "/"
  138.    TRANSMIT S9                  ; BAUD RATE
  139.    TRANSMIT ","
  140.    TRANSMIT S8                  ; ID
  141.    TRANSMIT "!"                 ; cr
  142.  
  143.    WAITFOR "="                  ; Wait for 'PASSWORD=' prompt
  144.  
  145.    TRANSMIT S7                  ; Enter password
  146.    TRANSMIT "!"                 ; cr
  147.  
  148.    RGET S5                      ; Get the CR echoed from our TRANSMIT
  149.    RGET S5                      ; Get the CR that precedes PCP messages
  150.    RGET S5                      ; Get the actual message
  151.    PAUSE 1                      ; Display it briefly
  152.  
  153.    FIND S5 "CONNECT"            ; Look for connection
  154.  
  155.    IF NOT FOUND                 ; No connection
  156.       CLEAR
  157.       MESSAGE "THE REMOTE PCP IS BUSY.  REDIALING..." S1
  158.       LOCATE 1 0
  159.       GOTO L3
  160.    ENDIF
  161.  
  162. ;
  163. ; Ok, made it to the remote PCP city.  Display appropriate message
  164. ; then call the actual destination, again using a redial
  165. ;
  166.  
  167.    CLEAR
  168.    MESSAGE "CONNECTED TO PCP"
  169.    LOCATE 0,17
  170.    MESSAGE S1
  171.    LOCATE 1,0
  172.    MESSAGE "DIALING"
  173.    LOCATE 1,8
  174.    MESSAGE S3
  175.  
  176. L4:                             ; label for busy number
  177.  
  178.    LOCATE 2 0
  179.    TRANSMIT "ATZ!"              ; Wake up remote modem
  180.    WAITFOR "OK"                 ; Wait for 'OK' prompt
  181.  
  182.    TRANSMIT "ATDT"
  183.    TRANSMIT S4                  ; THE NUMBER
  184.    TRANSMIT "!"                 ; CR
  185.  
  186.    RGET S0                      ; Get CR echoed from our TRANSMIT
  187.    RGET S0 80 40                ; Get CR that precedes PCP messages
  188.    RGET S0                      ; Get the real message
  189.    PAUSE 2
  190.  
  191.    FIND S0 "BUSY"               ; was it busy?
  192.    IF FOUND
  193.       CLEAR
  194.       MESSAGE "BUSY.  REDIALING..." S3
  195.       GOTO L4
  196.    ENDIF
  197.  
  198.    FIND S0 "CONNECT"            ; did it connect?
  199.    IF FOUND
  200.       SET PARITY NONE           ; Switch to N/8/1 for BBS work
  201.       SET DATABITS 8
  202.       CLEAR
  203.       MESSAGE "CONNECTED TO"
  204.       LOCATE 0,13
  205.       MESSAGE S3
  206.       LOCATE 1,0
  207.       MESSAGE "LOGON PRECEEDING"
  208.    ELSE                         ; not busy or connect, assume error
  209.       CLEAR
  210.       MESSAGE "NO CONNECT OR BUSY. REDIALING"
  211.       GOTO L4
  212.    ENDIF
  213.  
  214.    ALARM 2                      ; sound alarm for 2 seconds
  215.    EXIT                         ; we made it!
  216.  
  217.  
  218.  
  219. ;********************************************************************
  220. ;
  221. ; SUBROUTINES START HERE
  222. ;
  223. ; note that you could put these at the beginning of the file, and
  224. ; initially branch around them.  As each GOSUB and GOTO starts looking
  225. ; at the top of the file, it would speed up some parts of the process,
  226. ; while slowing down others.  Maybe next time we'll build a symbol table
  227. ; and eliminate this inefficiency.
  228. ;
  229. ;********************************************************************
  230.  
  231.  
  232. ATLANTA:
  233.  
  234.    CLEAR
  235.    LOCATE 5,0
  236.    MESSAGE "                         ┌──┤ ATLANTA BBS NUMBERS ├──┐"
  237.    MESSAGE "                         │                           │"
  238.    MESSAGE "                         │   1- ALTGATE              │"
  239.    MESSAGE "                         │   2- Flagship Express     │"
  240.    MESSAGE "                         │   3- BYTE Connection      │"
  241.    MESSAGE "                         │   4- Microstuf BBS        │"
  242.    MESSAGE "                         │   5- Software Link BBS    │"
  243.    MESSAGE "                         │   6- PC-Exchange BBS      │"
  244.    MESSAGE "                         │   M- Manual Dial          │"
  245.    MESSAGE "                         │                           │"
  246.    MESSAGE "                         ├───────────────────────────┤"
  247.    MESSAGE "                         │ ENTER THE # OF THE BBS OF │"
  248.    MESSAGE "                         │ YOUR CHOICE:              │"
  249.    MESSAGE "                         └───────────────────────────┘"
  250.  
  251. ATL1:
  252.  
  253.    LOCATE 17,40
  254.    MESSAGE  " "
  255.    LOCATE 17,40
  256.    GET S5 1
  257.  
  258.    SWITCH S5
  259.  
  260.       CASE "1"
  261.          ASSIGN S3 "ATLGATE"            ; save the BBS name
  262.          ASSIGN S4 "9281876"            ; save the number
  263.       ENDCASE
  264.  
  265.       CASE "2"
  266.          ASSIGN S3 "Flagship Express"
  267.          ASSIGN S4 "9344515"
  268.       ENDCASE
  269.  
  270.       CASE "3"
  271.          ASSIGN S3 "BYTE Connection"
  272.          ASSIGN S4 "9410159"
  273.       ENDCASE
  274.  
  275.       CASE "4"
  276.          ASSIGN S3 "Microstuf_BBS"
  277.          ASSIGN S4 "9988048"
  278.       ENDCASE
  279.  
  280.       CASE "5"
  281.          ASSIGN S3 "Software Link"
  282.          ASSIGN S4 "9986737"
  283.       ENDCASE
  284.  
  285.       CASE "6"
  286.          ASSIGN S3 "PC-Exchange BBS"
  287.          ASSIGN S4 "9776686"
  288.       ENDCASE
  289.  
  290.       CASE "M"
  291.          CLEAR
  292.          LOCATE 5,20
  293.          MESSAGE "NUMBER TO DIAL:"
  294.          LOCATE 5,36
  295.          ASSIGN S3 "MANUAL DIAL"
  296.          GET S4
  297.       ENDCASE
  298.  
  299.       DEFAULT
  300.          MESSAGE "^G"
  301.          LOCATE 17,40
  302.          GOTO ATL1
  303.       ENDCASE
  304.  
  305.    ENDSWITCH
  306. RETURN
  307.  
  308. DETROIT:
  309.  
  310.    CLEAR
  311.    LOCATE 5,0
  312.    MESSAGE "                         ┌──┤ DETROIT BBS NUMBERS ├──┐"
  313.    MESSAGE "                         │                           │"
  314.    MESSAGE "                         │   1- Computer Support BBS │"
  315.    MESSAGE "                         │   2- The Trading Post     │"
  316.    MESSAGE "                         │   3-                      │"
  317.    MESSAGE "                         │   4-                      │"
  318.    MESSAGE "                         │   5-                      │"
  319.    MESSAGE "                         │   6-                      │"
  320.    MESSAGE "                         │   M- Manual Dial          │"
  321.    MESSAGE "                         │                           │"
  322.    MESSAGE "                         ├───────────────────────────┤"
  323.    MESSAGE "                         │ ENTER THE # OF THE BBS OF │"
  324.    MESSAGE "                         │ YOUR CHOICE:              │"
  325.    MESSAGE "                         └───────────────────────────┘"
  326.  
  327. DET1:
  328.  
  329.    LOCATE 17,40
  330.    MESSAGE  " "
  331.    LOCATE 17,40
  332.    GET S5 1
  333.  
  334.    SWITCH S5
  335.  
  336.       CASE "1"
  337.          ASSIGN S3 "Computer Support BBS"
  338.          ASSIGN S4 "9464821"
  339.       ENDCASE
  340.  
  341.       CASE "2"
  342.          ASSIGN S3 "The Trading Post"
  343.          ASSIGN S4 "8827104"
  344.       ENDCASE
  345.  
  346.       CASE "M"
  347.          CLEAR
  348.          LOCATE 5,20
  349.          MESSAGE "NUMBER TO DIAL:"
  350.          LOCATE 5,36
  351.          ASSIGN S3 "MANUAL DIAL"
  352.          GET S4
  353.       ENDCASE
  354.  
  355.       DEFAULT
  356.          MESSAGE "^G"
  357.          LOCATE 17,40
  358.          GOTO DET1
  359.       ENDCASE
  360.  
  361.    ENDSWITCH
  362. RETURN
  363.  
  364.  
  365. WASHINGTON_DC:
  366.  
  367.    CLEAR
  368.    LOCATE 5,0
  369.    MESSAGE "                         ┌──┤ WASH DC BBS NUMBERS ├──┐"
  370.    MESSAGE "                         │                           │"
  371.    MESSAGE "                         │   1- PCPursuit BBS        │"
  372.    MESSAGE "                         │   2- In Pursuit of ...    │"
  373.    MESSAGE "                         │   3- Fannie Mae           │"
  374.    MESSAGE "                         │   4- Hotline BBS          │"
  375.    MESSAGE "                         │   5- Arquimedes           │"
  376.    MESSAGE "                         │   6- Compu Center         │"
  377.    MESSAGE "                         │   M- Manual Dial          │"
  378.    MESSAGE "                         │                           │"
  379.    MESSAGE "                         ├───────────────────────────┤"
  380.    MESSAGE "                         │ ENTER THE # OF THE BBS OF │"
  381.    MESSAGE "                         │ YOUR CHOICE:              │"
  382.    MESSAGE "                         └───────────────────────────┘"
  383.  
  384. WAS1:
  385.  
  386.    LOCATE 17,40
  387.    MESSAGE  " "
  388.    LOCATE 17,40
  389.    GET S5 1
  390.  
  391.    SWITCH S5
  392.  
  393.       CASE "1"
  394.          ASSIGN S3 "PCPursuit BBS"
  395.          ASSIGN S4 "6893561"
  396.          RETURN
  397.       ENDCASE
  398.  
  399.       CASE "2"
  400.          ASSIGN S3 "In Pursuit of..."
  401.          ASSIGN S4 "6892987"
  402.       ENDCASE
  403.  
  404.       CASE "3"
  405.          ASSIGN S3 "Fannie Mae"
  406.          ASSIGN S4 "5377475"
  407.       ENDCASE
  408.  
  409.       CASE "4"
  410.          ASSIGN S3 "Hotline BBS"
  411.          ASSIGN S4 "6833944"
  412.       ENDCASE
  413.  
  414.       CASE "5"
  415.          ASSIGN S3 "Arquimedes"
  416.          ASSIGN S4 "6988230"
  417.       ENDCASE
  418.  
  419.       CASE "6"
  420.          ASSIGN S3 "Compu Center"
  421.          ASSIGN S4 "9799250"
  422.       ENDCASE
  423.  
  424.       CASE "M"
  425.          CLEAR
  426.          LOCATE 5,20
  427.          MESSAGE "NUMBER TO DIAL:"
  428.          LOCATE 5,36
  429.          ASSIGN S3 "MANUAL DIAL"
  430.          GET S4
  431.       ENDCASE
  432.  
  433.       DEFAULT
  434.          MESSAGE "^G"
  435.          GOTO WAS1
  436.       ENDCASE
  437.  
  438.    ENDSWITCH
  439.  
  440. RETURN
  441.  
  442. ;************* End of Subroutines **********************************
  443.